#include<stdio.h>
void yrt(char yourString[]) {
	int i = 0;
	int k = 0;
	char your2DString[100][100] = { 0 };
	int r = 0;
	int c = 0;
	k = strlen(yourString);
	for (i = 0;i < k;i++) {
		if (yourString[i] != ' ') {
			your2DString[r][c] = yourString[i];
			c = c + 1;
		}
		else {
			r = r + 1;
			c = 0;
		}
	}

	char temp[100] = { 0 };
	for (int i = 0; i < 100; i++)
	{
		for (int j = i + 1; j < 100; j++)
		{
			if (strcmp(your2DString[i], your2DString[j]) > 0) {
				strcpy(temp, your2DString[i]);
				strcpy(your2DString[i], your2DString[j]);
				strcpy(your2DString[j], temp);
			}
		}
	}
	for (int i = 0; i < 100; i++)
	{
		if(strlen(your2DString[i]) != 0)
			printf("%s ", your2DString[i]);
	}

}

void main(void) {
	char message[100] = { 0 };
	printf("input a string: ");
	gets(message);
	yrt(message);
}


